package animation1.view.zhaolixiang.com.a1

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.view.animation.AnimationUtils
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        bt_scale1.setOnClickListener{
            val animation=AnimationUtils.loadAnimation(this,R.anim.scale1)
            tv_title.startAnimation(animation)
        }
        bt_scale2.setOnClickListener{
            val animation=AnimationUtils.loadAnimation(this,R.anim.scale2)
            tv_title.startAnimation(animation)
        }
        bt_scale3.setOnClickListener{
            val animation=AnimationUtils.loadAnimation(this,R.anim.scale3)
            tv_title.startAnimation(animation)
        }
        bt_alpha.setOnClickListener{
            val animation=AnimationUtils.loadAnimation(this,R.anim.alpha1)
            tv_title.startAnimation(animation)
        }
        bt_rotate.setOnClickListener{
            val animation=AnimationUtils.loadAnimation(this,R.anim.rotate1)
            tv_title.startAnimation(animation)
        }
        bt_translate.setOnClickListener{
            val animation=AnimationUtils.loadAnimation(this,R.anim.translate1)
            tv_title.startAnimation(animation)
        }
        bt_set.setOnClickListener{
            val animation=AnimationUtils.loadAnimation(this,R.anim.set1)
            tv_title.startAnimation(animation)
        }
    }
}
